/*
 * AboutFrame.java
 *
 * Created on 2007年10月20日, 上午2:54
 */

package cn.tearcry.jsudoku;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.*;
import javax.swing.*;


/**
 *
 * @author  马建乐
 */
public class AboutFrame extends javax.swing.JFrame implements ActionListener{
    Timer timer=new Timer(500,this);
    private String tempstr="";
    private int lineNumber=0;
    private int textLocation=0;
    /** Creates new form AboutFrame */
    public AboutFrame() {
        initComponents();
    }
    
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc=" 生成的代码 ">//GEN-BEGIN:initComponents
    private void initComponents() {
        okButton = new javax.swing.JButton();
        tabbedPane = new javax.swing.JTabbedPane();
        versionPanel = new javax.swing.JPanel();
        logoAndVersionLabel = new javax.swing.JLabel();
        contributorsPanel = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("\u5173\u4e8ejSudoku");
        okButton.setText("\u786e\u5b9a");
        okButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                okButtonActionPerformed(evt);
            }
        });

        logoAndVersionLabel.setFont(new java.awt.Font("宋体", 0, 13));
        logoAndVersionLabel.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
        logoAndVersionLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cn/tearcry/jsudoku/Resources/LOGO.png")));
        logoAndVersionLabel.setText("\u5236\u4f5c\uff1a\u7b2c8\u5c0f\u7ec4             \u7248\u672c:1.0");
        logoAndVersionLabel.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM);
        logoAndVersionLabel.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        logoAndVersionLabel.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);

        org.jdesktop.layout.GroupLayout versionPanelLayout = new org.jdesktop.layout.GroupLayout(versionPanel);
        versionPanel.setLayout(versionPanelLayout);
        versionPanelLayout.setHorizontalGroup(
            versionPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(versionPanelLayout.createSequentialGroup()
                .add(20, 20, 20)
                .add(logoAndVersionLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .add(20, 20, 20))
        );
        versionPanelLayout.setVerticalGroup(
            versionPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(versionPanelLayout.createSequentialGroup()
                .addContainerGap()
                .add(logoAndVersionLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 93, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(14, Short.MAX_VALUE))
        );
        tabbedPane.addTab("\u7248\u672c", versionPanel);

        contributorsPanel.addComponentListener(new java.awt.event.ComponentAdapter() {
            public void componentShown(java.awt.event.ComponentEvent evt) {
                contributorsPanelComponentShown(evt);
            }
        });

        jLabel1.setFont(new java.awt.Font("宋体", 0, 36));
        jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);

        org.jdesktop.layout.GroupLayout contributorsPanelLayout = new org.jdesktop.layout.GroupLayout(contributorsPanel);
        contributorsPanel.setLayout(contributorsPanelLayout);
        contributorsPanelLayout.setHorizontalGroup(
            contributorsPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(contributorsPanelLayout.createSequentialGroup()
                .add(37, 37, 37)
                .add(jLabel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 329, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(40, Short.MAX_VALUE))
        );
        contributorsPanelLayout.setVerticalGroup(
            contributorsPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(contributorsPanelLayout.createSequentialGroup()
                .add(24, 24, 24)
                .add(jLabel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 67, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(26, Short.MAX_VALUE))
        );
        tabbedPane.addTab("\u8d21\u732e\u8005", contributorsPanel);

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(layout.createSequentialGroup()
                        .add(193, 193, 193)
                        .add(okButton))
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
                        .addContainerGap()
                        .add(tabbedPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 411, Short.MAX_VALUE)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
                .add(tabbedPane, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 143, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(okButton)
                .addContainerGap())
        );
        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void contributorsPanelComponentShown(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_contributorsPanelComponentShown
        jLabel1.setText("");
        lineNumber=0;
        textLocation=0;
        timer.start();
        
    }//GEN-LAST:event_contributorsPanelComponentShown

    private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okButtonActionPerformed
        this.dispose();
    }//GEN-LAST:event_okButtonActionPerformed
    
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new AboutFrame().setVisible(true);
            }
        });
    }

    public void actionPerformed(ActionEvent e) {
        String[] content=new String[10];
        content[0]="李金海";
        content[1]="任堃";
        content[2]="王乐晓";
        content[3]="郭祥斌";
        content[4]="马建乐";
        content[5]="曾宇青";
        content[6]="董建林";
        content[7]="甘波";
        content[8]="霍达";
        content[9]="庄永贝";
     
            
           
            
        //lineNumber++;
       // jLabel1.setText("");
            
            if(textLocation==content[lineNumber].length()){
                textLocation=0;
                jLabel1.setText("");
                lineNumber++;
                tempstr="";
            }
            if(lineNumber==content.length){
                timer.stop();
                jLabel1.setText("我们是CO!");
                return;
            }
            
        
            tempstr+=content[lineNumber].substring(textLocation,textLocation+1);
            jLabel1.setText(tempstr);
            textLocation++;
            
            
        
        
        
     
    
        
    }
    public static void main(String args) {
        new AboutFrame().setVisible(true);
    }
    
    // 变量声明 - 不进行修改//GEN-BEGIN:variables
    public javax.swing.JPanel contributorsPanel;
    public javax.swing.JLabel jLabel1;
    public javax.swing.JLabel logoAndVersionLabel;
    public javax.swing.JButton okButton;
    public javax.swing.JTabbedPane tabbedPane;
    public javax.swing.JPanel versionPanel;
    // 变量声明结束//GEN-END:variables
    
}
